package com.bsoft.gol.hbs.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import ctd.spring.boot.annotation.SsdevDao;
import ctd.util.annotation.RpcService;
import hcn.base.feerule.SysBillingRule;
import java.util.List;
@SsdevDao(serviceId = "sysBillingRule")
public abstract class SysBillingRuleDAO extends HibernateSupportDelegateDAO<SysBillingRule> {

    public SysBillingRuleDAO() {
        this.setKeyField("sysBillingRuleId");
    }

    @DAOMethod(sql = " from SysBillingRule where orgId=:orgId and moduleId=:moduleId")
    public abstract List<SysBillingRule> findSysPayCofList(@DAOParam("orgId")String orgId, @DAOParam("moduleId")String moduleId);

    @RpcService
    @DAOMethod(sql = " from SysBillingRule where orgId=:orgId and moduleId=:moduleId and deliveryModeCode=:deliveryModeCode and drugType=:drugType")
    public abstract SysBillingRule getSysPayCofByDrugType(@DAOParam("orgId") String orgId, @DAOParam("moduleId") String moduleId, @DAOParam("deliveryModeCode") String deliveryModeCode, @DAOParam("drugType") Byte drugType);


    @DAOMethod(sql = " from SysBillingRule where orgId=:orgId and moduleId=:moduleId and deliveryModeCode=:deliveryModeCode")
    public abstract SysBillingRule getSysPayCofByDeliveryModeCode(@DAOParam("orgId") String orgId, @DAOParam("moduleId") String moduleId, @DAOParam("deliveryModeCode") String deliveryModeCode);


    @DAOMethod(sql = "from SysBillingRule where orgId=:orgId")
    public abstract SysBillingRule getSysBillingRuleByOrgId(@DAOParam("orgId")String orgId);
}
